/* 全局样式重置和基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  
  /* 主题色彩变量 */
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --accent-color: #45b7d1;
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --bg-overlay: rgba(0, 0, 0, 0.4);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.1);
  
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #000;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* 链接样式 */
a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-color);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3.2em;
}

h2 {
  font-size: 2.4em;
}

h3 {
  font-size: 1.8em;
}

/* 段落样式 */
p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* 按钮基础样式 */
button {
  border: none;
  border-radius: 8px;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 输入框样式 */
input, textarea {
  font-family: inherit;
  font-size: 1em;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.8em 1em;
  background: var(--bg-glass);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* 选择文本样式 */
::selection {
  background: var(--primary-color);
  color: white;
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid {
  display: grid;
}

.hidden {
  display: none;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

/* 系统缩放适配 */
html {
  /* 支持系统缩放 */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  
  /* 流体字体大小 */
  font-size: clamp(14px, 1vw + 0.5rem, 18px);
}

body {
  /* 确保内容适应视口 */
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* 容器自适应 */
.container {
  width: 100%;
  max-width: min(1400px, 95vw);
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.5vw, 2rem);
}

/* 响应式断点 */
@media (max-width: 1400px) {
  :root {
    font-size: clamp(13px, 0.9vw + 0.4rem, 16px);
  }
}

@media (max-width: 1200px) {
  :root {
    font-size: clamp(12px, 0.8vw + 0.3rem, 15px);
  }
}

@media (max-width: 768px) {
  :root {
    font-size: clamp(11px, 0.7vw + 0.2rem, 14px);
  }
  
  h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }
  
  h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
  }
  
  h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
  }
}

@media (max-width: 480px) {
  :root {
    font-size: clamp(10px, 0.6vw + 0.1rem, 13px);
  }
}

/* 高DPI屏幕适配 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* 系统偏好适配 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 流体布局工具类 */
.fluid-container {
  width: 100%;
  max-width: 100vw;
  padding: 0 clamp(1rem, 2.5vw, 2rem);
}

.fluid-text {
  font-size: clamp(0.875rem, 1.5vw, 1.125rem);
  line-height: 1.6;
}

.fluid-spacing {
  margin: clamp(1rem, 2.5vw, 2rem) 0;
  padding: clamp(0.5rem, 1.25vw, 1rem);
}
